package com.rp.prize.commons.db.mapper;

import com.rp.prize.commons.db.entity.Images;
import com.rp.prize.commons.db.entity.ImagesExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ImagesMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    long countByExample(ImagesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    int deleteByExample(ImagesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    @Delete({
        "delete from images",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    @Insert({
        "insert into images (name, url, ",
        "create_time)",
        "values (#{name,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(Images record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    int insertSelective(Images record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    List<Images> selectByExample(ImagesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, name, url, create_time",
        "from images",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.rp.prize.commons.db.mapper.ImagesMapper.BaseResultMap")
    Images selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") Images record, @Param("example") ImagesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") Images record, @Param("example") ImagesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(Images record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table images
     *
     * @mbg.generated
     */
    @Update({
        "update images",
        "set name = #{name,jdbcType=VARCHAR},",
          "url = #{url,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Images record);
}